home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / usr_-_Usr_Files / INCLUDE / SEMAPHOR.{3S < prev    next >
Text File  |  1999-09-17  |  2KB  |  45 lines

  1. /* Linuxthreads - a simple clone()-based implementation of Posix        */
  2. /* threads for Linux.                                                   */
  3. /* Copyright (C) 1996 Xavier Leroy (Xavier.Leroy@inria.fr)              */
  4. /*                                                                      */
  5. /* This program is free software; you can redistribute it and/or        */
  6. /* modify it under the terms of the GNU Library General Public License  */
  7. /* as published by the Free Software Foundation; either version 2       */
  8. /* of the License, or (at your option) any later version.               */
  9. /*                                                                      */
  10. /* This program is distributed in the hope that it will be useful,      */
  11. /* but WITHOUT ANY WARRANTY; without even the implied warranty of       */
  12. /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        */
  13. /* GNU Library General Public License for more details.                 */
  14.  
  15. #ifndef _SEMAPHORE_H
  16.  
  17. #define _SEMAPHORE_H    1
  18. #include <features.h>
  19. #include <limits.h>
  20.  
  21. #define SEM_VALUE_MAX INT_MAX
  22.  
  23. typedef struct {
  24.   int sem_spinlock;
  25.   long sem_status;
  26. } sem_t;
  27.  
  28. #if defined(__cplusplus)
  29. extern "C" {
  30. #endif
  31.  
  32. extern int sem_init __P((sem_t *__sem, int __pshared, unsigned int __value));
  33. extern int sem_destroy __P((sem_t *__sem));
  34. extern int sem_wait __P((sem_t *__sem));
  35. extern int sem_trywait __P((sem_t *__sem));
  36. extern int sem_post __P((sem_t *__sem));
  37. extern int sem_getvalue __P((sem_t *__sem, int *__sval));
  38.  
  39. #if defined(__cplusplus)
  40. }
  41. #endif
  42.  
  43. #endif  /* semaphore.h */
  44.  
  45.